<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title></title>

		<meta name="description" content="User login page" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

	<link rel="stylesheet" href="static/libs/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="static/libs/font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" href="static/libs/ace/css/ace-fonts.min.css" />
	<link rel="stylesheet" href="static/libs/ace/css/ace.min.css" />
		<!--[if lte IE 9]>
			<link rel="stylesheet" href="static/libs/ace/css/ace-part2.min.css" />
		<![endif]-->
		<link rel="stylesheet" href="static/libs/ace/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="static/libs/ace/css/ace-ie.min.css" />
		<![endif]-->

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		  <script src="static/libs/html5shiv/html5shiv.min.js"></script>
 		  <script src="static/libs/respond/respond.min.js"></script>
		<![endif]-->
	</head>
	<script src="static/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="static/libs/pace/pace.min.js" type="text/javascript" ></script>

<script src="static/js/zfes/zfes.alert.swal.js" type="text/javascript" ></script>
<script src="static/js/zfes/zfes.core.js" type="text/javascript" ></script>
<script src="static/js/zfes/zfes.ajax.js" type="text/javascript" ></script>
<script src="static/js/zfes/zfes.util.js" type="text/javascript" ></script>
	<body class="login-layout">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="ace-icon fa fa-coffee green"></i>
												请输入用户名密码
											</h4>

											<div class="space-6"></div>
<!-- http://127.0.0.1:8083/zht-framees-auth-shiro-server/ -->
											<form name="loginform" id="loginform" action="auth/login" method="post">
												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" id="username" name="username" class="form-control" placeholder="用户名" />
															<i class="ace-icon fa fa-user"></i>
														</span>
													</label>
														<div class="space"></div>
														<div class="clearfix">

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" id="password" name="password" class="form-control" placeholder="密码" />
															<i class="ace-icon fa fa-lock"></i>
														</span>
													</label>
													</div>

													<div class="space"></div>

													<div class="clearfix">
													 <!-- 	<label class="inline">
															<input type="checkbox" class="ace" id="rememberMe" name="rememberMe" />
															<span class="lbl"> 记住我</span>
														</label>  -->
														<label class="inline">

														<button type="button" id="loginbutton" class="width-35 pull-right btn btn-sm btn-primary" href="#" onclick="dologin()";">
															<i class="ace-icon fa fa-key"></i>
															
																<span class="bigger-110">登录</span>
														
															
														</button>
														</label>
													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>



										</div><!-- /.widget-main -->

									</div><!-- /.widget-body -->
								</div><!-- /.login-box -->


							</div><!-- /.position-relative -->

						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->

<!--[if !IE]> -->
<script src="static/libs/jquery/jquery1x.min.js"></script>
<![endif]-->

<!--[if IE]>
<script src="static/libs/jquery/jquery-2.2.4.min.js"></script>
<![endif]-->
<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='static/libs/jquery/jquery.mobile.custom.js'>"+"<"+"/script>");
		</script>
		<script type="text/javascript">
			jQuery(function($) {
				$('body').attr('class', 'login-layout blur-login');
				$('#id-text2').attr('class', 'white');
				$('#id-company-text').attr('class', 'light-blue');
			});
//------------------------------------------------------------------------------
function dologin(){
	var username = $("#username");
	alert(username.val());
	var password = $("#password");
	if(username.val().length < 1){
		username.focus();
		return;
	}
	if(password.val().length < 3){
		
		/* $("#login_error").empty();
		$("#login_error").append("<strong>错误</strong>：  密码至少3位");
		$("#login_error").css('display','block');  */
		password.focus();
		return;
	}
	alert("before--submitForm");
	
/* 	zfesAjax.submitForm($("#loginForm"), function(json){
		alert("submitForm");
		if(json.statusCode == KMCORE.statusCode.error) {
			$("#password").val("");
			if(json.message && alertMsg){
				$("#login_error").empty();
				$("#login_error").append("<strong>错误</strong>：  "+json.message);
				$("#login_error").css('display','block'); 
			}
		}else if(json.statusCode == KMCORE.statusCode.serverError) {
			$("#password").val("");
			if(json.message && alertMsg){
				$("#login_error").empty();
				$("#login_error").append("<strong>错误</strong>：  "+json.message);
				$("#login_error").css('display','block'); 
			}
		}else {
			$("#password").val("");
			if(json.message && alertMsg){
				setTimeout(function(){
					 window.top.location.href="${ctx}/core"; 
				},500);
				
			}
		};
	}); */
	//http://127.0.0.1:8083/zht-framees-auth-shiro-server/
    var ajaxUrl = "auth/login";
	var param = { "username" : username.val(),"password":password.val()};
	zfesAjax.ajaxTodo(ajaxUrl, param, function(data) {
		alertSwal.successText(data.message);
	});  
}
		</script>
	</body>
</html>
